﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;

namespace PGE.AfastamentosTempMVC.Modelo
{
    public class MyInitializer : IDatabaseInitializer<Contexto>
    {
        private readonly bool _exluir;

        public MyInitializer(bool exluir)
        {
            _exluir = exluir;
        }

        #region IDatabaseInitializer<Contexto> Members

        public void InitializeDatabase(Contexto context)
        {
            if (_exluir)
            {
                context.Database.Delete();
                context.Database.CreateIfNotExists();
            }
        }
        #endregion
    }
}
